 <!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> logo设置</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <include file="common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <style>
        .page{height:30px;}
        .page a,.pagin span{border:1px solid #ccc;padding:5px;margin-top:10px;clear:both;margin-left:10px;}
        .page span{width:20px;float:left;text-align: center;}
        .page a:hover{color:#f0580c;border-color:#f0580c;}

        .num{color:darkred;margin-right:10px;}
        .download{float:right;}
        .fa-trash{font-size:23px;}
    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>logo设置</h5>
                        <a class="btn btn-sm btn-success" style="float: right;margin-bottom: 3px;" href="javascript:location.replace(location.href);" title="刷新" >
                            <i class="fa fa-refresh"></i> </a>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <empty name="msg">
                                <div class="col-sm-1 m-b-xs">
                                    <a onclick="article_add('创建','__URL__/logoAddView','800','500')" class="btn btn-w-m btn-success">添加</a>
                                </div>
                            </empty>
                        </div>

                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>网站名称</th>
                                        <th>网站logo</th>
                                        <th>ico图标</th>
                                        <th>CRM logo</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <foreach name="msg" item="li">
                                    <tr>
                                        <td>{$li.id}</td>
                                        <td>{$li.web_name} （{$li.web_name_en}）</td>
                                        <td><img  height='50px' src="__ROOT__/{$li.logo}"/></td>
                                        <td><img  height='50px' src="__ROOT__/{$li.ico}"/></td>
                                        <td><img  height='50px' src="__ROOT__/{$li.crm_logo}"/></td>
                                        <td>
                                            <a href="javascript:;" onclick="rollDel('{$li.id}')"><i class="fa fa-trash text-navy"></i></a>
                                        </td>
                                    </tr>
                                </foreach>
                                </tbody>
                            </table>
                            <div class="page">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 全局js -->
    <include file="common_js"/>
    <!-- Peity -->
    <script src="__PUBLIC__/admin/js/plugins/peity/jquery.peity.min.js"></script>
    <!-- 自定义js -->
    <script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
    <script src="__PUBLIC__/common/js/layer_show.js"></script>
    <!-- iCheck -->
    <script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
    <!-- Peity -->
    <script src="__PUBLIC__/admin/js/demo/peity-demo.js"></script>
    <script>
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });

        function article_add(title,url,w,h){
            layer_show(title,url,w,h);
            $('.layui-layer-close').click(function () {
                location.reload();
            });
        }

        function article_edit(title,url,id,w,h){
            layer_show(title,url,w,h);
            $('.layui-layer-close').click(function () {
                location.reload();
            })
        }

        function rollDel(id) {
            layer.confirm("您确定要删除吗?",function(){
                $.ajax({
                    type:"POST",
                    url:"__URL__/deleteLogo",
                    data:{id: id},
                    success:function(data){
                        //alert(JSON.stringify(data));return;
                        //console.log('删除文件'+data.msg);
                        if(data.status==1){
                            layer.msg(data.msg);
                            setTimeout("location.reload()",1500);
                        }else{
                            layer.msg(data.msg,{icon: 2,time:2000});
                        }
                    },error:function(err){
                    }
                });
            })
        }
    </script>
</body>
</html>
